﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;

namespace Engine
{
    static public class AudioManager
    {
        //Habria que poner tantos audioEngines / sound y wave banks como tengamos.
        static AudioEngine weaponsEngine;
        static WaveBank waveBank;
        static SoundBank soundBank;

        static AudioEngine MenuEngine;
        static WaveBank menuWaveBank;
        static SoundBank menuSoundBank;

        static Cue menuCue;

        static public void Initialize()
        {
            weaponsEngine = new AudioEngine("Content\\Audio\\WeaponSounds.xgs");
            waveBank = new WaveBank(weaponsEngine, "Content\\Audio\\Weapon Banks.xwb");
            soundBank = new SoundBank(weaponsEngine, "Content\\Audio\\Weapon Sounds.xsb");

            MenuEngine = new AudioEngine("Content\\Audio\\MenuSound.xgs");
            menuWaveBank = new WaveBank(weaponsEngine, "Content\\Audio\\Menu WaveBank.xwb");
            menuSoundBank = new SoundBank(weaponsEngine, "Content\\Audio\\Menu SoundBank.xsb"); 
        }

        static public void PlaySound(string sound)
        {
            soundBank.PlayCue(sound);
        }
        static public void PlayMenuSound()
        {
            menuCue = menuSoundBank.GetCue("Mighty");
            menuCue.Play();
        }
        static public void StopMenuSound()
        {
            menuCue.Stop(AudioStopOptions.AsAuthored);
        }

    }
}
